Table of Contents

Set up

library(gtsummary)
library(tidyverse)
library(srvyr)
library(flextable)
library(officer)
library(labelled)
library(rlang)


Typical theme for gtsummary()

# For all I use the compact theme.
theme_gtsummary_compact()
## Setting theme "Compact"


Load Round 10 UK European Social Survey dataset.

ddir <- paste0(getwd())
load(paste0(ddir,"/ESS_UK_snippet_Round 10.RData"))
glimpse(ess10)
## Rows: 1,149
## Columns: 39
## $ idno         <dbl> 50002, 50008, 50021, 50023, 50033, 50052, 50100, 50129, 50191, 50242, 50297, 50344, 50347, 50378, …
## $ anweight     <dbl> 2.215882, 4.085495, 3.973622, 8.731745, 3.137663, 2.000416, 4.206257, 1.966309, 1.802065, 6.647645…
## $ stratum      <dbl> 1463, 1428, 1501, 1478, 1450, 1456, 1412, 1393, 1491, 1465, 1372, 1473, 1398, 1430, 1410, 1380, 14…
## $ psu          <dbl> 10279, 10236, 10327, 10300, 10387, 10102, 10263, 10413, 10150, 10115, 10208, 10287, 10118, 10401, …
## $ atchctr      <fct> 7, Very emotionally attached, 7, 4, 7, 6, 2, 8, 8, Not at all emotionally attached, 9, Very emotio…
## $ stflife      <fct> 8, 8, 7, 8, 5, 6, 6, 8, 8, 8, Extremely satisfied, 9, 7, 7, 6, 5, 8, 7, 7, 4, 5, Extremely satisfi…
## $ stfgov       <fct> 2, 7, 4, 4, 3, Extremely dissatisfied, 3, 5, 1, Extremely dissatisfied, 5, 5, 3, 2, 1, 4, 8, 5, 1,…
## $ psppsgva     <fct> Very little, Some, Very little, Some, Very little, Very little, Very little, Very little, Very lit…
## $ actrolga     <fct> Quite able, Not at all able, Not at all able, A little able, Not at all able, A little able, Quite…
## $ cptppola     <fct> Not at all confident, Not at all confident, Not at all confident, A little confident, A little con…
## $ lrscale      <fct> 5, 9, 5, 2, 6, 5, 6, 4, 4, 4, 5, 4, 2, 2, 3, 5, 6, 5, 2, 5, 5, 7, 3, NA, 3, NA, NA, 6, 4, 8, 5, 5,…
## $ gincdif      <fct> Disagree, Disagree, Neither agree nor disagree, Agree, Agree, Agree, Agree strongly, Agree, Agree …
## $ ppltrst      <fct> 7, 8, 4, 4, 6, 2, 6, 9, 7, 6, 4, 4, 7, 4, 7, 5, 6, 5, 8, 5, 4, 5, 8, 5, 6, 5, 5, 7, 8, 3, 3, 8, 8,…
## $ trstplt      <fct> 2, 7, 3, 2, No trust at all, 1, No trust at all, 6, 4, 7, 3, 1, 5, 2, 5, 3, 7, 5, 2, 5, No trust a…
## $ imwbcnt      <fct> 7, 3, 6, Better place to live, 4, 5, 9, 5, 7, 9, 7, 6, 8, 8, 8, 5, 5, 9, 9, 5, 6, 3, 8, 8, 6, 8, W…
## $ sclmeet      <fct> Once a month, Several times a month, Less than once a month, Several times a week, Once a month, N…
## $ gndr         <fct> Male, Female, Male, Female, Female, Female, Female, Male, Female, Male, Male, Female, Female, Male…
## $ agea         <dbl> 72, 83, 69, 21, 64, 70, 51, 86, 41, 57, 62, 67, 72, 19, 46, 37, 55, 73, 27, 28, 52, 15, 70, 44, 76…
## $ hincfel      <fct> Living comfortably on present income, Living comfortably on present income, Coping on present inco…
## $ ctzcntr      <fct> Yes, Yes, Yes, No, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes,…
## $ brncntr      <fct> Yes, Yes, Yes, No, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes,…
## $ feethngr     <fct> Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Yes, No, Yes, Yes, Yes, No, Yes, Yes, Yes, Yes, Yes, Yes, …
## $ rlgblg       <fct> No, No, Yes, No, No, Yes, No, No, No, No, No, No, No, Yes, No, No, Yes, No, No, No, No, No, Yes, Y…
## $ rlgblge      <fct> No, Yes, NA, Yes, No, NA, No, No, No, Yes, No, Yes, No, NA, No, No, NA, No, Yes, No, No, Yes, NA, …
## $ vote         <fct> Yes, Yes, Yes, No, Yes, No, Yes, Yes, Yes, Yes, Yes, Yes, Yes, Not eligible to vote, Yes, Yes, Yes…
## $ prtvtdgb     <fct> Labour, Conservative, Conservative, NA, NA, NA, Liberal Democrat, Labour, Labour, Scottish Nationa…
## $ mainact      <fct> NA, NA, NA, NA, NA, NA, NA, NA, NA, "Retired", NA, "Paid work", NA, "Education", NA, "Paid work", …
## $ mnactic      <fct> "Retired", "Retired", "Retired", "Education", "Paid work", "Retired", "Paid work", "Retired", "Pai…
## $ atchctr_num  <dbl> 7, 10, 7, 4, 7, 6, 2, 8, 8, 0, 9, 10, 10, 4, 4, 8, 10, 10, 5, 10, 7, 5, 10, 8, 2, 5, 10, 3, 7, 8, …
## $ stflife_num  <dbl> 8, 8, 7, 8, 5, 6, 6, 8, 8, 8, 10, 9, 7, 7, 6, 5, 8, 7, 7, 4, 5, 10, 9, 7, 3, 3, 10, 2, 4, 8, 6, 5,…
## $ stfgov_num   <dbl> 2, 7, 4, 4, 3, 0, 3, 5, 1, 0, 5, 5, 3, 2, 1, 4, 8, 5, 1, 5, 0, 7, 3, 7, 0, 2, 3, 1, 8, 7, 3, 2, 4,…
## $ psppsgva_num <dbl> 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 4, 4, 3, 2, 3, 2, 3, 2, 2, 3, 3, 1, 2, 1, 2, 2, 2, 4,…
## $ actrolga_num <dbl> 3, 1, 1, 2, 1, 2, 3, 4, 3, 3, 2, 1, 2, 1, 2, 4, 4, 3, 2, 1, 1, 3, 3, 1, 2, 2, 2, 1, 1, 2, 2, 3, 4,…
## $ cptppola_num <dbl> 1, 1, 1, 2, 2, 1, 4, 4, 4, 4, 3, 1, 3, 1, 3, 3, 4, 2, 3, 1, 1, 3, 3, 2, 2, 5, 2, 1, 1, 4, 1, 4, 4,…
## $ lrscale_num  <dbl> 5, 9, 5, 2, 6, 5, 6, 4, 4, 4, 5, 4, 2, 2, 3, 5, 6, 5, 2, 5, 5, 7, 3, NA, 3, NA, NA, 6, 4, 8, 5, 5,…
## $ gincdif_num  <dbl> 4, 4, 3, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 3, 3, 1, 5, 2, 1, 3, 3, 1, 3, 2,…
## $ ppltrst_num  <dbl> 7, 8, 4, 4, 6, 2, 6, 9, 7, 6, 4, 4, 7, 4, 7, 5, 6, 5, 8, 5, 4, 5, 8, 5, 6, 5, 5, 7, 8, 3, 3, 8, 8,…
## $ trstplt_num  <dbl> 2, 7, 3, 2, 0, 1, 0, 6, 4, 7, 3, 1, 5, 2, 5, 3, 7, 5, 2, 5, 0, 5, 6, 4, 1, 0, 0, 0, 3, 2, 2, 3, 5,…
## $ imwbcnt_num  <dbl> 7, 3, 6, 10, 4, 5, 9, 5, 7, 9, 7, 6, 8, 8, 8, 5, 5, 9, 9, 5, 6, 3, 8, 8, 6, 8, 0, 3, 2, 7, 5, 7, 9…
svy_df <- ess10 %>% as_survey_design(weights = anweight)

# List all .R files in ddir 
file_paths <- list.files(path = ddir, pattern = "\\.R$", full.names = TRUE, all.files = T) %>% 
  map_chr(., ~str_remove(.x, ddir)) %>% 
  grep("_interim", ., value =T, invert = T) # Drop interim functions, not used.

# Set of functions to be loaded. 
file_paths
##  [1] "/.col_width.R"             "/addh.R"                   "/base_information.R"       "/bases_equal.R"           
##  [5] "/create_bases.R"           "/gtsummary_table_notes.R"  "/mtotals.R"                "/multicodes.R"            
##  [9] "/nest_multicodes.R"        "/nested_tables.R"          "/prepare_base_for_table.R" "/revise_labels.R"         
## [13] "/splitter_present.R"       "/style_hux_df.R"           "/tables.R"                 "/totals.R"


Load functions

# Load all functions (make sure no other .R files in this location)
map(file_paths, ~source(paste0(ddir,.x)))


Load additional binary data

The code below loads some additional data, for use in multicoded tables.

load("/Users/joecrowley/R/Data/ESS_UK/ESS_UK_R_data_file.RData")

# Use set of variables on location people can access internet from
ess %>% select(starts_with("acc")) %>% map_df(.,var_label) %>% pivot_longer(cols = everything())
namevalue
accdngFeel accomplishment from what I do
accalawAcceptable for country to have a strong leader above the law
acchomeLocation able to access the internet: Home
accwrkLocation able to access the internet: Workplace
accmoveLocation able to access the internet: On the move
accothLocation able to access the internet: Some other place
accnoneLocation able to access the internet: None of the above
accrefLocation able to access the internet: Refusal
accdkLocation able to access the internet: Don't know
accnaLocation able to access the internet: No answer
# Identify variable names
int_loc <- ess %>% select(starts_with("acc")) %>% names
int_loc <- int_loc[3:10]
int_loc
## [1] "acchome" "accwrk"  "accmove" "accoth"  "accnone" "accref"  "accdk"   "accna"
ess %>% select(all_of(int_loc)) %>% map_df(.,var_label) %>% pivot_longer(cols = everything())
namevalue
acchomeLocation able to access the internet: Home
accwrkLocation able to access the internet: Workplace
accmoveLocation able to access the internet: On the move
accothLocation able to access the internet: Some other place
accnoneLocation able to access the internet: None of the above
accrefLocation able to access the internet: Refusal
accdkLocation able to access the internet: Don't know
accnaLocation able to access the internet: No answer
ess10 %>% select(ctzcntr, brncntr,feethngr) %>% look_for() %>% convert_list_columns_to_character() %>% flextable

pos

variable

label

col_type

missing

levels

value_labels

1

ctzcntr

Citizen of country

fct

1

Yes; No; Refusal; Don't know; No answer

2

brncntr

Born in country

fct

1

Yes; No; Refusal; Don't know; No answer

3

feethngr

Feel part of same race or ethnic group as most people in country

fct

9

Yes; No; Refusal; Don't know; No answer



Overview of process

Some checks

  • all have same base size?
  • contains splitter in variable labels? (: )
  • not contains multiple splitters.

Steps.

  1. Checks above,
  2. Relabel variables, store stem
  3. Create unweighted base variable,
  4. Create vector of variables to use,
  5. Create table,
  6. Optional, add caption,
  7. Optional, add CI.

Proposed variables testing multicodes

ess %>% select(all_of(int_loc)) %>% look_for(details = "none")
posvariablelabel
1acchomeLocation able to access the internet: Home
2accwrkLocation able to access the internet: Workplace
3accmoveLocation able to access the internet: On the move
4accothLocation able to access the internet: Some other place
5accnoneLocation able to access the internet: None of the above
6accrefLocation able to access the internet: Refusal
7accdkLocation able to access the internet: Don't know
8accnaLocation able to access the internet: No answer


Checks

Bases equal

unique_base_sizes <- 
  ess %>% 
  select(all_of(int_loc)) %>% 
  map_int(., ~sum(is.na(.x))) %>% 
  unique()

unique_base_sizes
## [1] 19830
length(unique_base_sizes) == 1
## [1] TRUE
# As function, returns TRUE if equal

bases_equal <- function(
    df, # data frame
    vars # character vector of variables
    ) {
  
  unique_base_sizes <- 
  df %>% 
  select(all_of(vars)) %>% 
  map_int(., ~sum(is.na(.x))) %>% 
  unique()

unique_base_sizes

result <- length(unique_base_sizes) == 1

return(result)

}

bases_equal(ess, int_loc)
## [1] TRUE
writeLines(
  c("bases_equal <- ", # Assignment needs to be added manually
  deparse(bases_equal)), # Extract function code
  paste0(ddir,"/bases_equal.R")) # File name is just the function name 


Labels contain splitter

I combine checks 2 and 3 in the below

labels_contain_splitter <- 
  ess %>% 
  select(all_of(int_loc)) %>%
  var_label(unlist = T, null_action = "fill") %>% 
  map_int(., ~str_count(.x, ": "))

labels_contain_splitter
## acchome  accwrk accmove  accoth accnone  accref   accdk   accna 
##       1       1       1       1       1       1       1       1
# Check each label contains the splitter
length(labels_contain_splitter) == sum(labels_contain_splitter)
## [1] TRUE
# Check no label contains the splitter more than once
max(labels_contain_splitter) == 1
## [1] TRUE
# As a function, returns TRUE if all contain splitter
splitter_present <- function(
    df, 
    vars) { 
  
  labels_contain_splitter <- 
    df %>% 
    select(all_of(vars)) %>%
    var_label(unlist = T, null_action = "fill") %>% 
    map_int(., ~str_count(.x, ": "))

  labels_contain_splitter
  
  # Check each label contains the splitter, returns TRUE if they do
  all_contain_splitter <- length(labels_contain_splitter) == sum(labels_contain_splitter)
  
  # Check no label contains the splitter more than once, returns TRUE all equal 1
  splitter_appears_once_each <- max(labels_contain_splitter) == 1
  
  # result is TRUE if both statements equal true. 
  result <- all_contain_splitter == TRUE & splitter_appears_once_each == TRUE
  return(result)

}

splitter_present(ess, int_loc)
## [1] TRUE
writeLines(
  c("splitter_present <- ", # Assignment needs to be added manually
  deparse(splitter_present)), # Extract function code
  paste0(ddir,"/splitter_present.R")) # File name is just the function name 


Split variable labels and store stem

# Testing data frame
ess2 <- ess

# Create a list containing the revised variables
revised_labels_as_list <- 
  map(int_loc, function(xxx) { 
  variable_label <- ess %>% select(all_of(xxx)) %>% var_label %>% str_split_i(., ": ", 2)
  return(variable_label)
}) 
names(revised_labels_as_list) <- int_loc # add names

# Revise variable labels
var_label(ess2) <- revised_labels_as_list

# Review corrected labels...
ess2 %>% 
  select(all_of(int_loc)) %>%
  var_label(unlist = T, null_action = "fill")
##             acchome              accwrk             accmove              accoth             accnone              accref 
##              "Home"         "Workplace"       "On the move"  "Some other place" "None of the above"           "Refusal" 
##               accdk               accna 
##        "Don't know"         "No answer"
# Extract stem - I won't make this a function, it's very simple.
ess %>% pull(int_loc[1]) %>% var_label() %>% str_split_i(., ": ", 1)
## [1] "Location able to access the internet"
# As a function - returns relabelled data frame... 
revise_labels <- function(
    df, # data frame
    vars # character vector of variable names
    ) {
  
  # Create a list containing the revised variables
  revised_labels_as_list <- 
    map(vars, function(xxx) { 
    variable_label <- df %>% select(all_of(xxx)) %>% var_label %>% str_split_i(., ": ", 2)
    return(variable_label)
  }) 
  names(revised_labels_as_list) <- vars # add names

  # Revise variable labels
  var_label(df) <- revised_labels_as_list
  return(df)
  
}

# Apply function
ess2 <- revise_labels(ess, int_loc)

# Review corrected labels...
ess2 %>% 
  select(all_of(int_loc)) %>%
  var_label(unlist = T, null_action = "fill")
##             acchome              accwrk             accmove              accoth             accnone              accref 
##              "Home"         "Workplace"       "On the move"  "Some other place" "None of the above"           "Refusal" 
##               accdk               accna 
##        "Don't know"         "No answer"
writeLines(
  c("revise_labels <- ", # Assignment needs to be added manually
  deparse(revise_labels)), # Extract function code
  paste0(ddir,"/revise_labels.R")) # File name is just the function name 


Data set up

These functions are going to expect well managed data.

You can provide variables which are either:

  • yes / no.
  • 0 / 1.
  • TRUE / FALSE

All variables must have those levels, even if not observed for a particular variable.

# Variables must be factors, drop unused levels..
ess3 <- ess %>% 
  mutate(across(all_of(int_loc), ~fct_drop(to_factor(.x))))

# gtsummary expects yes/no, 0/1 or TRUE/FALSE for dichotomous variables
ess3$acchome %>% levels # we have 'Not marked' / 'Marked'
## [1] "Not marked" "Marked"
ess3 <- ess3 %>% 
  mutate(across(all_of(int_loc), ~fct_recode(.x, 
        "Yes" = "Marked", "No" = "Not marked")))
## Warning: There were 3 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `across(all_of(int_loc), ~fct_recode(.x, Yes = "Marked", No = "Not marked"))`.
## Caused by warning:
## ! Unknown levels in `f`: Marked
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 2 remaining warnings.
ess3$acchome %>% levels
## [1] "No"  "Yes"
# Note they do all need to have the two levels...
# When adding factor levels remember to use forcats to preserve variable labels
# If done with factor() variable labels will be dropped. 
ess3 %>% select(all_of(int_loc)) %>% map(., levels)
## $acchome
## [1] "No"  "Yes"
## 
## $accwrk
## [1] "No"  "Yes"
## 
## $accmove
## [1] "No"  "Yes"
## 
## $accoth
## [1] "No"  "Yes"
## 
## $accnone
## [1] "No"  "Yes"
## 
## $accref
## [1] "No"
## 
## $accdk
## [1] "No"
## 
## $accna
## [1] "No"
ess3 <- ess3 %>% mutate(across(all_of(int_loc), ~fct_expand(.x, c("Yes", "No")))) 
ess3 %>%  select(all_of(int_loc)) %>% map(., levels)
## $acchome
## [1] "No"  "Yes"
## 
## $accwrk
## [1] "No"  "Yes"
## 
## $accmove
## [1] "No"  "Yes"
## 
## $accoth
## [1] "No"  "Yes"
## 
## $accnone
## [1] "No"  "Yes"
## 
## $accref
## [1] "No"  "Yes"
## 
## $accdk
## [1] "No"  "Yes"
## 
## $accna
## [1] "No"  "Yes"
var_label(ess %>% select(all_of(int_loc)))
## $acchome
## [1] "Location able to access the internet: Home"
## 
## $accwrk
## [1] "Location able to access the internet: Workplace"
## 
## $accmove
## [1] "Location able to access the internet: On the move"
## 
## $accoth
## [1] "Location able to access the internet: Some other place"
## 
## $accnone
## [1] "Location able to access the internet: None of the above"
## 
## $accref
## [1] "Location able to access the internet: Refusal"
## 
## $accdk
## [1] "Location able to access the internet: Don't know"
## 
## $accna
## [1] "Location able to access the internet: No answer"
# Age
ess3 %>% count(age)
agen
151
15.07999992370611
15.17000007629393
15.251
15.32999992370611
15.42000007629391
15.51
15.57999992370613
15.67000007629391
15.754
15.82999992370611
15.92000007629394
161
16.07999992370611
16.17000007629391
16.253
16.32999992370614
16.42000007629391
16.53
16.57999992370612
16.67000007629393
16.751
16.82999992370614
16.92000007629392
17.17000007629391
17.253
17.42000007629393
17.58
17.57999992370612
17.67000007629394
17.754
17.82999992370612
18.07999992370616
18.17000007629391
18.252
18.32999992370613
18.42000007629391
18.52
18.57999992370614
18.67000007629391
18.752
18.82999992370611
18.92000007629391
191
19.07999992370611
19.17000007629392
19.252
19.32999992370612
19.42000007629393
19.53
19.57999992370612
19.67000007629391
19.751
19.82999992370613
19.92000007629393
207
20.07999992370612
20.17000007629391
20.251
20.32999992370612
20.42000007629393
20.51
20.57999992370613
20.67000007629393
20.752
20.82999992370614
20.92000007629394
213
21.07999992370612
21.17000007629394
21.252
21.42000007629394
21.51
21.57999992370615
21.82999992370615
21.92000007629391
221
22.07999992370611
22.17000007629394
22.252
22.32999992370611
22.42000007629392
22.52
22.57999992370612
22.67000007629392
22.751
22.82999992370611
23.07999992370612
23.17000007629393
23.252
23.32999992370611
23.42000007629392
23.52
23.57999992370614
23.67000007629394
23.82999992370614
23.92000007629395
241
24.07999992370612
24.17000007629396
24.252
24.32999992370614
24.42000007629391
24.51
24.57999992370612
24.67000007629398
24.82999992370611
24.92000007629395
25.07999992370614
25.17000007629397
25.251
25.32999992370613
25.42000007629392
25.51
25.57999992370613
25.67000007629392
25.753
25.92000007629395
265
26.07999992370611
26.17000007629394
26.253
26.32999992370611
26.42000007629393
26.56
26.57999992370612
26.67000007629392
26.753
26.82999992370611
26.92000007629391
274
27.07999992370612
27.17000007629391
27.258
27.32999992370612
27.42000007629393
27.52
27.57999992370612
27.67000007629391
27.752
27.82999992370611
281
28.07999992370614
28.17000007629395
28.32999992370614
28.42000007629391
28.53
28.57999992370611
28.751
28.82999992370613
28.92000007629392
296
29.17000007629393
29.252
29.32999992370612
29.42000007629394
29.51
29.57999992370615
29.67000007629394
29.755
29.82999992370613
29.92000007629393
303
30.07999992370612
30.17000007629393
30.253
30.32999992370612
30.42000007629393
30.53
30.57999992370614
30.67000007629393
30.758
30.82999992370615
30.92000007629392
314
31.17000007629391
31.253
31.32999992370612
31.42000007629395
31.51
31.57999992370612
31.67000007629393
31.752
31.82999992370612
31.92000007629393
324
32.08000183105472
32.16999816894533
32.252
32.33000183105471
32.41999816894534
32.55
32.58000183105473
32.66999816894533
32.752
32.83000183105473
32.91999816894538
337
33.08000183105471
33.16999816894535
33.253
33.33000183105472
33.41999816894534
33.55
33.58000183105474
33.66999816894537
33.751
33.83000183105474
33.91999816894531
344
34.08000183105475
34.16999816894532
34.253
34.33000183105472
34.41999816894533
34.51
34.58000183105474
34.66999816894531
34.753
34.83000183105476
34.91999816894535
357
35.08000183105473
35.16999816894534
35.254
35.33000183105477
35.41999816894531
35.53
35.58000183105472
35.66999816894532
35.752
35.83000183105473
35.91999816894532
367
36.08000183105472
36.16999816894536
36.255
36.33000183105473
36.41999816894533
36.54
36.58000183105475
36.66999816894532
36.753
36.83000183105471
36.91999816894533
371
37.08000183105478
37.16999816894536
37.255
37.33000183105475
37.55
37.58000183105473
37.66999816894535
37.753
37.83000183105476
37.91999816894533
385
38.08000183105476
38.16999816894532
38.254
38.33000183105472
38.41999816894532
38.51
38.58000183105477
38.66999816894531
38.752
38.83000183105474
38.91999816894533
393
39.08000183105476
39.16999816894535
39.253
39.33000183105473
39.41999816894537
39.52
39.58000183105476
39.66999816894534
39.752
39.83000183105472
39.91999816894533
402
40.08000183105474
40.16999816894532
40.254
40.33000183105473
40.41999816894534
40.53
40.58000183105472
40.66999816894538
40.757
40.83000183105471
40.91999816894538
416
41.08000183105475
41.16999816894531
41.253
41.33000183105471
41.41999816894538
41.56
41.58000183105476
41.66999816894533
41.83000183105473
422
42.08000183105475
42.16999816894534
42.254
42.330001831054711
42.41999816894533
42.54
42.58000183105476
42.66999816894531
42.753
42.83000183105473
42.91999816894533
434
43.08000183105473
43.16999816894534
43.253
43.33000183105474
43.41999816894531
43.52
43.58000183105476
43.66999816894532
43.752
43.83000183105473
444
44.16999816894535
44.253
44.33000183105474
44.41999816894536
44.56
44.58000183105475
44.66999816894538
44.753
44.83000183105475
44.91999816894534
452
45.08000183105475
45.16999816894531
45.252
45.33000183105474
45.41999816894533
45.58
45.58000183105473
45.66999816894533
45.756
45.83000183105475
462
46.08000183105472
46.16999816894533
46.254
46.33000183105473
46.41999816894534
46.52
46.58000183105476
46.66999816894533
46.751
46.83000183105472
46.91999816894532
471
47.08000183105471
47.16999816894533
47.252
47.33000183105473
47.41999816894532
47.51
47.58000183105472
47.66999816894533
47.754
47.83000183105477
47.91999816894535
482
48.16999816894532
48.255
48.33000183105473
48.41999816894533
48.55
48.58000183105476
48.66999816894534
48.753
48.83000183105473
48.91999816894535
495
49.08000183105471
49.16999816894534
49.253
49.33000183105472
49.41999816894532
49.54
49.58000183105474
49.66999816894536
49.754
49.83000183105472
49.91999816894532
504
50.08000183105472
50.16999816894534
50.251
50.33000183105474
50.41999816894535
50.52
50.58000183105472
50.66999816894534
50.753
50.83000183105471
50.91999816894531
513
51.08000183105471
51.16999816894535
51.251
51.33000183105473
51.55
51.58000183105473
51.66999816894532
51.753
51.83000183105471
51.91999816894538
521
52.08000183105475
52.16999816894532
52.255
52.33000183105471
52.41999816894535
52.52
52.58000183105474
52.66999816894535
52.753
52.83000183105472
52.91999816894531
533
53.08000183105474
53.16999816894534
53.253
53.33000183105474
53.41999816894532
53.58000183105472
53.66999816894531
53.91999816894531
542
54.08000183105475
54.16999816894534
54.252
54.33000183105471
54.41999816894537
54.54
54.58000183105474
54.66999816894531
54.756
54.83000183105472
54.91999816894533
552
55.08000183105475
55.16999816894532
55.252
55.41999816894532
55.53
55.58000183105472
55.66999816894532
55.751
55.83000183105474
55.91999816894534
565
56.08000183105471
56.16999816894531
56.254
56.33000183105472
56.41999816894535
56.52
56.58000183105473
56.752
56.83000183105474
56.91999816894536
573
57.08000183105472
57.16999816894535
57.254
57.33000183105473
57.41999816894537
57.52
57.58000183105475
57.66999816894532
57.758
57.83000183105472
57.91999816894534
58.08000183105473
58.16999816894534
58.255
58.33000183105472
58.41999816894532
58.53
58.58000183105472
58.66999816894534
58.751
58.83000183105478
58.91999816894532
592
59.08000183105472
59.16999816894533
59.258
59.33000183105474
59.41999816894537
59.57
59.58000183105475
59.66999816894533
59.758
59.83000183105474
59.91999816894532
605
60.08000183105471
60.16999816894538
60.252
60.33000183105473
60.41999816894535
60.51
60.58000183105475
60.66999816894531
60.752
60.83000183105472
60.91999816894534
612
61.16999816894533
61.257
61.33000183105474
61.41999816894535
61.55
61.58000183105475
61.66999816894537
61.754
61.83000183105471
61.91999816894535
621
62.08000183105471
62.16999816894532
62.255
62.33000183105473
62.41999816894534
62.54
62.58000183105475
62.66999816894532
62.751
62.83000183105473
62.91999816894531
632
63.08000183105471
63.16999816894534
63.257
63.33000183105476
63.41999816894535
63.53
63.58000183105473
63.66999816894534
63.754
63.83000183105471
63.91999816894531
643
64.08000183105472
64.16999816894531
64.254
64.33000183105471
64.41999816894533
64.54
64.58000183105472
64.66999816894533
64.753
64.83000183105472
64.91999816894533
653
65.08000183105471
65.16999816894532
65.252
65.33000183105472
65.41999816894533
65.53
65.58000183105471
65.66999816894533
65.752
65.83000183105472
65.91999816894532
664
66.08000183105474
66.16999816894534
66.257
66.33000183105471
66.41999816894535
66.55
66.58000183105476
66.66999816894534
66.752
66.83000183105472
66.91999816894531
678
67.08000183105473
67.16999816894532
67.251
67.33000183105472
67.41999816894533
67.53
67.58000183105474
67.66999816894534
67.752
67.83000183105472
67.91999816894533
68.08000183105472
68.16999816894532
68.252
68.33000183105472
68.41999816894532
68.55
68.58000183105474
68.66999816894532
68.755
68.91999816894532
691
69.08000183105473
69.16999816894534
69.252
69.33000183105472
69.41999816894532
69.54
69.58000183105473
69.66999816894533
69.752
69.83000183105472
69.91999816894531
702
70.08000183105472
70.16999816894532
70.33000183105475
70.41999816894532
70.52
70.58000183105472
70.66999816894533
70.754
70.83000183105472
70.91999816894533
711
71.08000183105471
71.16999816894533
71.252
71.33000183105474
71.41999816894531
71.51
71.58000183105472
71.66999816894535
71.752
71.83000183105472
71.91999816894532
721
72.08000183105473
72.16999816894535
72.252
72.33000183105473
72.41999816894533
72.52
72.58000183105471
72.66999816894532
72.754
72.83000183105476
731
73.08000183105473
73.16999816894532
73.251
73.33000183105474
73.53
73.58000183105473
73.66999816894534
73.753
73.83000183105474
73.91999816894533
742
74.08000183105472
74.16999816894531
74.252
74.33000183105473
74.41999816894531
74.51
74.58000183105472
74.66999816894531
74.752
74.91999816894534
752
75.08000183105477
75.16999816894533
75.254
75.33000183105474
75.41999816894532
75.54
75.58000183105474
75.66999816894532
75.751
75.83000183105473
761
76.08000183105473
76.16999816894532
76.252
76.33000183105473
76.58000183105471
76.66999816894532
76.754
76.83000183105471
76.91999816894532
77.08000183105471
77.16999816894531
77.252
77.33000183105471
77.41999816894533
77.53
77.58000183105472
77.66999816894531
77.751
77.83000183105473
77.91999816894533
782
78.16999816894532
78.252
78.33000183105472
78.41999816894532
78.51
78.58000183105472
78.66999816894531
78.751
78.83000183105473
78.91999816894531
792
79.16999816894531
79.253
79.33000183105471
79.41999816894532
79.52
79.58000183105472
79.66999816894531
79.751
79.83000183105472
80.08000183105471
80.251
80.33000183105471
80.41999816894531
80.53
80.66999816894531
80.754
80.83000183105472
80.91999816894532
811
81.08000183105472
81.16999816894533
81.252
81.33000183105472
81.41999816894532
81.52
81.58000183105473
81.66999816894531
81.751
81.91999816894531
822
82.08000183105472
82.16999816894533
82.252
82.33000183105473
82.41999816894533
82.51
82.58000183105471
82.66999816894535
82.751
82.83000183105471
82.91999816894531
833
83.08000183105471
83.16999816894533
83.252
83.33000183105473
83.41999816894532
83.51
83.58000183105471
83.66999816894534
83.91999816894531
841
84.08000183105471
84.16999816894532
84.251
84.33000183105471
84.41999816894531
84.66999816894531
84.751
84.83000183105471
851
85.08000183105471
85.255
85.54
85.58000183105472
85.66999816894531
85.83000183105471
85.91999816894531
863
86.08000183105471
86.251
86.33000183105471
86.41999816894531
86.53
86.58000183105471
86.66999816894533
86.751
86.91999816894532
872
87.08000183105471
87.16999816894532
87.33000183105472
87.53
87.58000183105471
87.91999816894531
882
88.08000183105471
88.251
88.41999816894531
88.51
88.751
89.33000183105471
89.66999816894531
901
90.251
90.33000183105471
90.66999816894531
90.752
90.83000183105471
91.51
91.58000183105471
91.66999816894531
92.08000183105471
92.58000183105471
92.91999816894531
93.16999816894531
94.91999816894531
96.751
18592
sum(is.na(ess3$age))
## [1] 18592
ess3 <- ess3 %>% mutate(age30 = fct_drop(to_factor(ageyo30)))
ess3 %>% count(age30)
age30n
29 or under404
30 or older1938
18637
# Gender
ess3 %>% count(gndr)
gndrn
19402
211565
12
sum(is.na(ess3$gndr))
## [1] 12
ess3 <- ess3 %>% mutate(gndr2 = fct_drop(to_factor(gndr)))
ess3 %>% count(gndr2)
gndr2n
Male9402
Female11565
12
# Ethnicity
ess3 %>% select(contains("pray"))
pray
7
7
6
4
6
7
6
1
1
5
6
1
2
6
6
3
6
7
1
1
4
1
1
7
4
1
1
4
1
7
2
4
7
1
7
7
3
7
7
6
7
1
7
1
7
3
7
6
7
1
2
1
6
7
4
6
7
1
7
7
7
7
6
7
7
7
4
6
7
1
6
7
1
7
6
7
5
6
6
7
7
1
1
1
7
4
1
6
7
1
1
6
3
7
1
4
7
7
4
7
1
7
1
7
7
7
7
1
7
7
7
7
4
1
4
3
7
7
1
7
2
1
1
4
7
3
1
1
1
7
1
6
1
7
7
6
7
3
7
6
6
2
7
7
1
7
1
6
3
3
7
7
7
6
1
1
6
7
1
1
6
7
4
1
7
6
7
1
7
1
3
7
7
7
7
7
7
6
7
1
1
7
7
7
7
7
2
1
7
7
7
7
4
7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
7
7
1
7
6
7
7
7
1
1
1
6
7
6
1
7
7
6
7
6
7
2
7
4
7
4
6
7
6
7
1
6
2
7
7
6
7
7
7
3
7
7
7
7
7
7
1
6
6
7
6
2
1
7
6
5
4
3
7
2
7
6
7
6
2
7
6
6
7
7
7
1
7
7
1
2
1
1
7
7
6
7
4
1
7
3
7
3
7
6
3
1
1
2
7
7
7
7
6
7
1
7
1
7
1
7
6
7
7
4
3
1
1
7
2
7
7
7
7
7
1
7
6
7
7
4
7
6
7
7
6
1
7
7
5
6
7
1
7
1
6
1
7
7
2
6
7
6
5
7
7
4
7
7
6
1
7
6
2
1
7
7
7
7
6
6
7
7
4
2
7
7
3
7
7
7
7
7
1
6
7
7
7
7
2
4
3
7
6
1
7
3
7
7
5
6
ess3 <- ess3 %>% mutate(pray2 = fct_drop(to_factor(pray)))
ess3 %>% count(pray2)
pray2n
Every day3924
More than once a week1349
Once a week1113
At least once a month1151
Only on special holy days378
Less often3184
Never9771
109
# Multicodes
svy_df <- ess3 %>% filter(!is.na(anweight)) %>% as_survey_design(weights = anweight)


The main function

Applying the function itself.

multicodes <- function(
    df, # data frame 
    vars, # vars
    ci = FALSE, # Confidence intervals, set to TRUE
    caption = NULL, # Replace with caption string
    breaks = NULL, # character vector of crossbreaks
    sig = F, 
    bases = NULL, # The object with base descriptions (from base_information() function)
    source = NULL, # A string describing the data source
    footnotes = NULL # Other character strings as footnotes, each on its own line.
) {
  
  # Check whether survey data or not (T = survey; F = data frame)
  whether_survey_data <- if(
     class(df) %>% 
      grep("survey.design", ., value = T) %>% 
      length() > 0
  ){T} else {F}
  
  # Create object that is always the data frame, not a survey design object
  dataset_reference <- if(whether_survey_data == F){df} else {df[["variables"]]}
  
  # Check variable labels contain ": " and that the base of each variable is equal
  chk1 <- splitter_present(dataset_reference, vars)
  chk2 <- bases_equal(dataset_reference, vars)
  
  # If both checks are TRUE create table
  if (chk1 == TRUE & chk2 == TRUE) {

  # Add variable reflecting number of non-missing cases
  dataset_reference <- dataset_reference %>% 
    mutate(unweighted_base = case_when(
      !is.na(df %>% pull(vars[1])) ~ "Unweighted bases", 
      TRUE ~ NA)
      )
  var_label(dataset_reference$unweighted_base) <- ""

  # Add unweighted base variable to vector of outcomes
  var_set <- c(vars, "unweighted_base")
  
  # Extract variable labels
  variable_label_stem <- dataset_reference %>% pull(vars[1]) %>% var_label() %>% str_split_i(., ": ", 1)

  # Remove stem from variable labels
  dataset_reference <- revise_labels(dataset_reference, vars = vars)
  
  # Put data back into original object
  if(whether_survey_data == T){
    df2 <- df
    df2[["variables"]] <- dataset_reference
  } else {
    df2 <- dataset_reference
  }
  
  # Choose gtsummary function to use
  if(whether_survey_data == T){summary_fun <- tbl_svysummary} else {summary_fun <- tbl_summary}
  
  # Define base size statistic to use
  if(whether_survey_data == T){n_statistic <- "{n_unweighted}"} else {n_statistic <- "{n}"}
  
  # Create table
  tbl <- df2 %>%
    summary_fun(
      include = all_of(var_set),
      type = list(unweighted_base ~ "categorical"),
      missing = "no", 
      statistic = list(all_dichotomous() ~ "{p}", 
                        all_categorical() ~ "{p}",
                        unweighted_base ~ n_statistic), 
      digits = list(all_dichotomous() ~ 1)
    ) 
  
    # Confidence intervals. 
  if (ci == TRUE) {
    tbl <- tbl %>% 
      add_ci(
       include = -unweighted_base,
       statistic = list(all_categorical() ~ "[{conf.low} - {conf.high}]"),
       style_fun = all_categorical() ~ label_style_sigfig(scale = 100, digits = 1)
       )
    }
  
  if(!is.null(breaks)){
    suppressWarnings({suppressMessages({
    
     brk_tbls <- map(breaks, 
        ~df2 %>%
          filter(!is.na(.data[[.x]])) %>%
          summary_fun(
            include = all_of(var_set),
            by = all_of(.x),
            type = list(unweighted_base ~ "categorical"),
            missing = "no", 
            statistic = list(all_dichotomous() ~ "{p}", 
                              all_categorical() ~ "{p}",
                              unweighted_base ~ n_statistic), 
            digits = list(all_dichotomous() ~ 1)
          ))
  
    if(sig == TRUE){
      
      brk_tbls <- map(brk_tbls, 
                      ~.x %>% 
          add_p(include = !all_of("unweighted_base"))
        )
    } 
     
    # Confidence intervals. 
    if (ci == TRUE) {
      brk_tbls <- map(brk_tbls, 
        ~.x %>% 
          add_ci(
           include = -unweighted_base,
           statistic = list(all_categorical() ~ "[{conf.low} - {conf.high}]"),
           style_fun = all_categorical() ~ label_style_sigfig(scale = 100, digits = 1)
           )
        )
    }
    
    brk_tbls <- map2(brk_tbls, breaks, 
        ~.x %>%
          modify_spanning_header(
            all_stat_cols() ~ paste0("**",var_label(dataset_reference[[.y]]),"**"),
            # Added to ensure CI + p.value included in spanning headers
            starts_with("ci_stat") | contains("p.value") ~ paste0("**",var_label(dataset_reference[[.y]]),"**"), 
            ) 
        )
     
     tbl <- append(list(tbl), brk_tbls) %>% tbl_merge(tab_spanner = FALSE)
     
    })})
    
  }
  
  # Edit caption when crossbreaks present. 
  if(!is.null(breaks) & is.null(caption)){
      caption <- paste0("Crosstabulation of ", variable_label_stem)
  } else if (is.null(caption)){
    caption <- ""
    }
  
  tbl <- tbl %>%
    
    # Set headers
    modify_header(all_stat_cols() ~ "**{level}**", 
                  label ~ paste0("**",variable_label_stem,"**"), 
                  # stat_0 ~ "**%**"
                  ) %>% 
    
    # Add a caption
    modify_caption(paste0("<div style='text-align: left; font-weight: bold; color: black'>", 
                        caption,
                        "</div>")) 
  
    # Footnote - whether weighted or unweighted
    if(whether_survey_data == T){
           stat_types <- "All statistics shown in this table are weighted."
         } else {stat_types <- "All statistics shown in this table are unweighted."
      }

    tbl <- tbl %>%
      modify_footnote(all_stat_cols() ~ NA) %>% # Suppress standard footnotes
      modify_footnote_header(columns = "label", stat_types, replace = F)

  # Simplify column header when there are no crossbreaks
  if (is.null(breaks)){tbl <- tbl %>% modify_header(starts_with("stat_0") ~ "**%**")}
    
  if(!is.null(breaks)){
    bases_variables <- c("multicode_labels", breaks)
  }
   
    
    if(!is.null(bases)) {
      
      description_of_multicode_variables <- bases[[2]] %>% unique
      names(description_of_multicode_variables) <- "multicode_labels"
      label_of_multicode_variables <- variable_label_stem
      names(label_of_multicode_variables) <- "multicode_labels"

      bases[[2]] <- c(bases[[2]], description_of_multicode_variables)
      bases[[3]] <- c(bases[[3]], label_of_multicode_variables)
      bases[[4]] <- c(bases[[4]], label_of_multicode_variables)
      
      } 
  
  footnotes <- gtsummary_table_notes(
    bases_info = bases, 
    vars = bases_variables, 
    source_note = source, 
    other_footnotes = footnotes
  )

  if (footnotes != ""){
    tbl <- tbl %>% modify_source_note(
    source_note = footnotes, 
    text_interpret = "html")
  }
  
  return(tbl)

  } else {
    
    helpful_error_message <- paste0("Not working: chk1 = ", chk1,", chk2 = ", chk2)
    return(helpful_error_message)
    
  }

}

writeLines(
  c("multicodes <- ", # Assignment needs to be added manually
  deparse(multicodes)), # Extract function code
  paste0(ddir,"/multicodes.R")) # File name is just the function name 


Examples

Example 1

multicodes(df = ess3, vars = int_loc, source = "European Social Survey")
Location able to access the internet1 %
Home 91.0
Workplace 43.0
On the move 61.3
Some other place 51.0
None of the above 7.3
Refusal 0.0
Don't know 0.0
No answer 0.0

    Unweighted bases 1,149


Source: European Social Survey
1 All statistics shown in this table are unweighted.


Example 2

multicodes(df = ess3, vars = int_loc, ci = T, caption = "Multicoded table caption", footnotes = c("This is what footnotes", "Can look like", "<br>See?")) 
Multicoded table caption
Location able to access the internet1 % 95% CI
Home 91.0 [89 - 93]
Workplace 43.0 [40 - 46]
On the move 61.3 [58 - 64]
Some other place 51.0 [48 - 54]
None of the above 7.3 [6 - 9]
Refusal 0.0 [0.0 - 0.4]
Don't know 0.0 [0.0 - 0.4]
No answer 0.0 [0.0 - 0.4]


    Unweighted bases 1,149
Abbreviation: CI = Confidence Interval


Footnotes:
This is what footnotes

Can look like


See?
1 All statistics shown in this table are unweighted.


Example 3

multicodes(df = ess3, vars = int_loc, breaks = c("gndr2"), sig =T)
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall
Gender
Male Female p-value2
Home 91.0 92.7 89.7 0.082
Workplace 43.0 47.0 39.8 0.014
On the move 61.3 65.6 57.9 0.007
Some other place 51.0 52.0 50.2 0.6
None of the above 7.3 5.9 8.4 0.11
Refusal 0.0 0.0 0.0 >0.9
Don't know 0.0 0.0 0.0 >0.9
No answer 0.0 0.0 0.0 >0.9




    Unweighted bases 1,149 506 643
1 All statistics shown in this table are unweighted.
2 Pearson’s Chi-squared test; Fisher’s exact test


Example 4

multicodes(df = ess3, vars = int_loc, breaks = c("gndr2"), ci = T)
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall 95% CI
Gender
Male 95% CI Female 95% CI
Home 91.0 [89 - 93] 92.7 [90 - 95] 89.7 [87 - 92]
Workplace 43.0 [40 - 46] 47.0 [43 - 51] 39.8 [36 - 44]
On the move 61.3 [58 - 64] 65.6 [61 - 70] 57.9 [54 - 62]
Some other place 51.0 [48 - 54] 52.0 [48 - 56] 50.2 [46 - 54]
None of the above 7.3 [6 - 9] 5.9 [4 - 8] 8.4 [6 - 11]
Refusal 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7]
Don't know 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7]
No answer 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7]






    Unweighted bases 1,149
506
643
Abbreviation: CI = Confidence Interval
1 All statistics shown in this table are unweighted.


Example 5

multicodes(df = ess3, vars = int_loc, breaks = c("gndr2","pray2"))
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall
Gender
How often pray apart from at religious services
Male Female Every day More than once a week Once a week At least once a month Only on special holy days Less often Never
Home 91.0 92.7 89.7 85.2 96.6 86.0 91.4 100.0 93.2 91.8
Workplace 43.0 47.0 39.8 27.9 42.4 46.0 39.7 41.7 48.8 46.1
On the move 61.3 65.6 57.9 42.1 66.1 48.0 63.8 33.3 69.8 65.4
Some other place 51.0 52.0 50.2 38.8 44.1 50.0 56.9 25.0 53.1 54.7
None of the above 7.3 5.9 8.4 12.6 3.4 10.0 6.9 0.0 5.6 6.6
Refusal 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Don't know 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
No answer 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0










    Unweighted bases 1,149 506 643 183 59 50 58 12 162 622
1 All statistics shown in this table are unweighted.


Example 6

multicodes(df = ess3, vars = int_loc, breaks = c("gndr2","pray2"), ci =T)
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall 95% CI
Gender
How often pray apart from at religious services
Male 95% CI Female 95% CI Every day 95% CI More than once a week 95% CI Once a week 95% CI At least once a month 95% CI Only on special holy days 95% CI Less often 95% CI Never 95% CI
Home 91.0 [89 - 93] 92.7 [90 - 95] 89.7 [87 - 92] 85.2 [79 - 90] 96.6 [87 - 99] 86.0 [73 - 94] 91.4 [80 - 97] 100.0 [70 - 100] 93.2 [88 - 96] 91.8 [89 - 94]
Workplace 43.0 [40 - 46] 47.0 [43 - 51] 39.8 [36 - 44] 27.9 [22 - 35] 42.4 [30 - 56] 46.0 [32 - 61] 39.7 [27 - 53] 41.7 [16 - 71] 48.8 [41 - 57] 46.1 [42 - 50]
On the move 61.3 [58 - 64] 65.6 [61 - 70] 57.9 [54 - 62] 42.1 [35 - 50] 66.1 [53 - 78] 48.0 [34 - 62] 63.8 [50 - 76] 33.3 [11 - 65] 69.8 [62 - 77] 65.4 [62 - 69]
Some other place 51.0 [48 - 54] 52.0 [48 - 56] 50.2 [46 - 54] 38.8 [32 - 46] 44.1 [31 - 58] 50.0 [37 - 63] 56.9 [43 - 70] 25.0 [7 - 57] 53.1 [45 - 61] 54.7 [51 - 59]
None of the above 7.3 [6 - 9] 5.9 [4 - 8] 8.4 [6 - 11] 12.6 [8 - 18] 3.4 [0.6 - 13] 10.0 [4 - 23] 6.9 [2 - 18] 0.0 [0.0 - 30] 5.6 [3 - 11] 6.6 [5 - 9]
Refusal 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7] 0.0 [0.0 - 3] 0.0 [0.0 - 8] 0.0 [0.0 - 9] 0.0 [0.0 - 8] 0.0 [0.0 - 30] 0.0 [0.0 - 3] 0.0 [0.0 - 0.8]
Don't know 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7] 0.0 [0.0 - 3] 0.0 [0.0 - 8] 0.0 [0.0 - 9] 0.0 [0.0 - 8] 0.0 [0.0 - 30] 0.0 [0.0 - 3] 0.0 [0.0 - 0.8]
No answer 0.0 [0.0 - 0.4] 0.0 [0.0 - 0.9] 0.0 [0.0 - 0.7] 0.0 [0.0 - 3] 0.0 [0.0 - 8] 0.0 [0.0 - 9] 0.0 [0.0 - 8] 0.0 [0.0 - 30] 0.0 [0.0 - 3] 0.0 [0.0 - 0.8]




















    Unweighted bases 1,149
506
643
183
59
50
58
12
162
622
Abbreviation: CI = Confidence Interval
1 All statistics shown in this table are unweighted.

multicodes(df = svy_df, vars = int_loc, breaks = c("gndr2","pray2"), ci = F)
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall
Gender
How often pray apart from at religious services
Male Female Every day More than once a week Once a week At least once a month Only on special holy days Less often Never
Home 94.7 95.5 94.0 90.3 97.6 91.7 95.7 100.0 96.8 95.1
Workplace 52.9 59.1 46.9 35.4 51.8 54.6 42.8 55.4 59.8 56.8
On the move 70.7 75.2 66.3 49.5 74.3 55.0 76.5 49.4 80.0 74.6
Some other place 58.6 58.8 58.4 50.2 47.9 58.7 64.0 38.3 62.1 60.9
None of the above 4.2 3.4 5.0 8.3 2.4 6.6 3.7 0.0 2.5 3.7
Refusal 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Don't know 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
No answer 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0










    Unweighted bases 1,149 506 643 183 59 50 58 12 162 622
1 All statistics shown in this table are weighted.


Applying base size arguments

int_loc
## [1] "acchome" "accwrk"  "accmove" "accoth"  "accnone" "accref"  "accdk"   "accna"
var_descriptions <- rep("Asked of all respondents as well, but with a separate label for testing", 8)
names(var_descriptions) <- int_loc
var_descriptions
##                                                                   acchome 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accwrk 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                   accmove 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accoth 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                   accnone 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accref 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                     accdk 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                     accna 
## "Asked of all respondents as well, but with a separate label for testing"
example_of_base_information <- base_information(
  data = ess3,
  general_base = "Asked of all respondents", 
  specific_bases = var_descriptions
)

map(example_of_base_information, head)
## [[1]]
## [1] "Asked of all respondents"
## 
## [[2]]
##                                                                   acchome 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accwrk 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                   accmove 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accoth 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                   accnone 
## "Asked of all respondents as well, but with a separate label for testing" 
##                                                                    accref 
## "Asked of all respondents as well, but with a separate label for testing" 
## 
## [[3]]
##                                                   acchome                                                    accwrk 
##              "Location able to access the internet: Home"         "Location able to access the internet: Workplace" 
##                                                   accmove                                                    accoth 
##       "Location able to access the internet: On the move"  "Location able to access the internet: Some other place" 
##                                                   accnone                                                    accref 
## "Location able to access the internet: None of the above"           "Location able to access the internet: Refusal" 
## 
## [[4]]
##                                 name                             essround                              edition 
##                   "Title of dataset"                          "ESS round"                            "Edition" 
##                             proddate                                 idno                                cntry 
##                    "Production date" "Respondent's identification number"                            "Country"
multicodes(df = ess3, vars = int_loc, breaks = c("gndr2"), ci = F, bases = example_of_base_information)
Crosstabulation of Location able to access the internet
Location able to access the internet1 Overall
Gender
Male Female
Home 91.0 92.7 89.7
Workplace 43.0 47.0 39.8
On the move 61.3 65.6 57.9
Some other place 51.0 52.0 50.2
None of the above 7.3 5.9 8.4
Refusal 0.0 0.0 0.0
Don't know 0.0 0.0 0.0
No answer 0.0 0.0 0.0



    Unweighted bases 1,149 506 643

Variable base descriptions:
Asked of all respondents as well, but with a separate label for testing: Location able to access the internet

All other variables: Asked of all respondents
1 All statistics shown in this table are unweighted.